# Adding Maps to our App

Since we're making a Windows 8 app it only makes sense to start off working with maps using Microsoft's Bing Maps.

1. If you haven't already, you will need to download and install the [Bing Maps SDK for Windows Store apps](http://visualstudiogallery.msdn.microsoft.com/bb764f67-6b2c-4e14-b2d3-17477ae1eaca).  This will allow you to use Maps in your Windows 8 app by adding files to your project when you need it.

2. You will need to add references to the Bing Maps for JavaScript in your app package.  You can accomplish this in your project in two ways:
- Going to Project > Add Reference > Select Bing Maps for JavaScript
or
- Right Click References in the Solution Explorer Window > Click Add Reference > Select Bing Maps for Javascript

3. Now that the References are there in your project, you can add the Bing Maps JavaScript files to your app like you would in a normal web site/app; by adding the library files into the ````<head>```` section of ````default.html````.

###### example
````html
	<script type="text/javascript" src="ms-appx:///Bing.Maps.JavaScript//js/veapicore.js"></script>
	<script type="text/javascript" src="ms-appx:///Bing.Maps.JavaScript//js/veapimodules.js"></script>
````

###### default.html
````html
<head>
    <meta charset="utf-8" />
    <title>Bixi</title>
    <!-- WinJS references -->
    <link href="//Microsoft.WinJS.1.0/css/ui-dark.css" rel="stylesheet" />
    <script src="//Microsoft.WinJS.1.0/js/base.js"></script>
    <script src="//Microsoft.WinJS.1.0/js/ui.js"></script>
    <!-- Bing Map Control references -->
    <script type="text/javascript" src="ms-appx:///Bing.Maps.JavaScript//js/veapicore.js"></script>
    <script type="text/javascript" src="ms-appx:///Bing.Maps.JavaScript//js/veapimodules.js"></script>
</head>
````

You can now load the Maps Module. 

````javascript
Microsoft.Maps.loadModule('Microsoft.Maps.Map', { callback: initMap, culture: 'en-us', homeRegion: 'US' });
````

When you run ````Micorsoft.Maps.loadModule()```` it takes 2 arguments; the first is the module to load, the second contains information to the callback function to fire, and the regional information that the map should be aware of.

\* You can register your own module by using:
````javascript
Microsoft.Maps.registerModule('myCustomModule');
````
where ````myCustomModule```` references a JavaScript file named ````myCustomModule.js````.